fix(website): migrate website to pnpm + fix MDX/dep issues blocking deploy#49
Merged
Conversation
…eploy The deploy-website workflow has been failing since #26 (pnpm migration) with `npm ci` crashing ("Exit handler never called!", 8-min OOM) and, after #46, a Turbopack MDX syntax error. Root causes and fixes: 1. MDX syntax error (PR #46): bare `{previous.output}` / `{args.*}` / `{item.*}` in zh-cn/guides/background-runs.mdx were parsed as JSX expressions by acorn. Wrapped them in inline code backticks. 2. Migrate the website from npm to pnpm (the rest of the monorepo uses pnpm; the website was the lone npm holdout). Add `website` to pnpm-workspace.yaml, delete website/package-lock.json, and rewrite deploy-website.yml to use pnpm/action-setup + `pnpm install --frozen-lockfile` + `pnpm run build`. pnpm installs in ~15s vs npm ci's 8-min crash. 3. Declare missing direct deps that npm hoisting had hidden: add `lucide-react` (imported in app/[lang]/*) and `@types/mdx` (imported in components/mdx.tsx) to website/package.json. pnpm's strict node_modules does not hoist transitive deps, so these must be explicit. Verified locally: clean `pnpm install --frozen-lockfile` + `pnpm run build` emits all 86 static pages (en + zh-cn).
c4bae0e to
21e578c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
deploy-websiteworkflow has been failing since #26 (pnpm migration). Three root causes, all fixed here.1. MDX syntax error (introduced by #46)
content/docs/zh-cn/guides/background-runs.mdxline 321 had bare{previous.output}/{args.*}/{item.*}in prose. MDX parses{...}as JSX expressions, and acorn choked (SyntaxError: Unexpected token). Wrapped them in inline code backticks.2.
npm cicrashing after pnpm migrationAfter #26 deleted the root
package-lock.json, the workflow'snpm ci(run insidewebsite/) crashed withnpm error Exit handler never called!after ~8 minutes (OOM). The website was the lone npm holdout in an otherwise-pnpm monorepo.Fix: migrate the website to pnpm — add
websitetopnpm-workspace.yaml, deletewebsite/package-lock.json, rewritedeploy-website.ymlto usepnpm/action-setup+pnpm install --frozen-lockfile+pnpm run build. pnpm installs in ~15s vs npm ci's 8-min crash.3. Missing direct dependencies (hidden by npm hoisting)
pnpm's strict
node_modulesdoes not hoist transitive deps. Two imports that worked under npm's hoisting now fail under pnpm:lucide-reactapp/[lang]/{page,layout,docs/.../page}.tsx^1.21.0, matching fumadocs-ui)mdx/typescomponents/mdx.tsx@types/mdx@^2.0.14)Verified locally
Workflow after merge
deploy-website.ymlruns on push tomain(paths:website/**,docs/**, etc.). This PR will trigger it on merge — that run is the real validation.